package com.rdxer.api;

import com.rdxer.core.entity.Result;
import com.rdxer.core.entity.StatusCode;
import com.rdxer.core.security.AppUserDetails;
import com.rdxer.model.Clazz;
import com.rdxer.model.Course;
import com.rdxer.service.ClazzService;
import com.rdxer.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * departmentManagement
 */
@RestController
@CrossOrigin
@RequestMapping("/clazz")
public class ClazzApi {

    @Autowired
    private ClazzService service;

    /**
     * 查询全部数据
     *
     * @return
     */
    @GetMapping
    public Result<Clazz> clazz() {
        return new Result<>(true, StatusCode.OK, "查询成功", service.findByUserId(AppUserDetails.getCurrent().account.getId()));
    }
}
